import request from '@/utils/request'

/**
 * 获取负责人列表
 * @returns
 */
export const getEmployeesSimleApi = () => {
  return request({
    url: '/sys/user/simple'
  })
}
// 获取员工
export function getWorkerAPI(data) {
  return request({
    url: '/sys/user',
    params: data
  })
}
// 获取单个员工
// 获取员工基本信息 (包含头像)
export function getUserInfoApi(id) {
  return request({
    method: 'get',
    url: `/sys/user/${id}`
  })
}
// 删除员工
export function delWokerAPI(id) {
  return request({
    method: 'delete',
    url: `/sys/user/${id}`,
    params: id
  })
}
// 添加员工
export const addEmployeesSimleApi = data => {
  return request({
    url: '/sys/user',
    method: 'post',
    data
  })
}
// 批量添加员工
export function reqImportEmployee(data) {
  return request({
    url: '/sys/user/batch',
    method: 'post',
    data
  })
}
// 修改员工
export function editEmployeeAPI(data) {
  return request({
    url: '/sys/user/`${data.id}`',
    method: 'put',
    data
  })
}
// 分配员工的角色
export function changeEmployeeAPI(data) {
  return request({
    url: '/sys/user/assignRoles',
    method: 'put',
    data
  })
}
